<?php
$type = $_GET['type'] ? : 1;
switch($type){
    case 1 : mysqlType();break;
    case 2 : mysqlitype();break;
    case 3 : pdotype();break;
}



function mysqlType(){
    $num = rand(66642,66666);
    $db =mysql_connect('localhost', 'root', '62951413');
    mysql_select_db('irenren', $db);
    $sql = 'select * from my_test where id=1 ';
    $query = mysql_query($sql);
    $info = mysql_fetch_assoc($query);
    if($info['num']>0){
        usleep(200);
        mysql_query('update my_test  set num=num-1 where id=1 and num>0');
    }
    
    
}